//
//  LYmineView.m
//  音伴尔家听宝
//
//  Created by Burgess on 2017/4/10.
//  Copyright © 2017年 Burgess. All rights reserved.
//

#import "LYmineView.h"

@implementation LYmineView


- (void)drawRect:(CGRect)rect {
 
    
    _background.backgroundColor = [UIColor colorWithRed:49.0/255.0 green:61.0/255.0 blue:62.0/255.0 alpha:1.0];
    _downbackground.backgroundColor = LyBackgroundColor;
}
+(instancetype)initmineview{
    LYmineView * mineview = [[[NSBundle mainBundle]loadNibNamed:@"LYView" owner:self options:NULL]firstObject];
    mineview.recordBtn.layer.cornerRadius = mineview.recordBtn.bounds.size.width*0.02;
    [mineview.recordBtn.layer setMasksToBounds:YES];
    [mineview.recordBtn.layer setCornerRadius:10.0]; //设置矩形四个圆角半径
    //边框宽度
    [mineview.recordBtn setTitleColor:LySystemColor forState:UIControlStateNormal];
    [mineview.recordBtn.layer setBorderWidth:1.2];
    //设置边框颜色有两种方法：第一种如下:
    [mineview.recordBtn.layer setBorderColor:LySystemColor.CGColor];//边框颜色
    
    [mineview.fansNum setTextColor:LySystemColor];
    [mineview.soundNum setTextColor:LySystemColor];
    [mineview.courseNum setTextColor:LySystemColor];
    [mineview.attentionNum setTextColor:LySystemColor];
    
    return mineview;
}
-(instancetype)initWithCoder:(NSCoder*)aDecoder{
    
    return [super initWithCoder:aDecoder];
}
-(void)awakefromNib{
    NSLog(@"awakefromNib   ---   ");
    [super awakeFromNib];
}

#pragma mark - 按钮的点击事件

//  点击用户头像
- (IBAction)clickUserIcon:(id)sender {
    if ([self.delegate respondsToSelector:@selector(userIconClick)]) {
        [self.delegate userIconClick];
    }
}

//  点击登录按钮
- (IBAction)clickLoginBtn:(id)sender {
    if ([self.delegate respondsToSelector:@selector(loginBtnClick)]) {
        [self.delegate loginBtnClick];
    }
}

//  点击我的声音按钮
- (IBAction)clickMySound:(id)sender {
    if ([self.delegate respondsToSelector:@selector(fourMyBtnClick:)]) {
        [self.delegate fourMyBtnClick:sender];
    }
}

//  点击我的课程按钮
- (IBAction)clickMyCourse:(id)sender {
    if ([self.delegate respondsToSelector:@selector(fourMyBtnClick:)]) {
        [self.delegate fourMyBtnClick:sender];
    }
}


//  点击我的关注按钮
- (IBAction)clickMyAttention:(id)sender {
    if ([self.delegate respondsToSelector:@selector(fourMyBtnClick:)]) {
        [self.delegate fourMyBtnClick:sender];
    }
}

//  点击我的粉丝按钮
- (IBAction)clickMyFans:(id)sender {
    if ([self.delegate respondsToSelector:@selector(fourMyBtnClick:)]) {
        [self.delegate fourMyBtnClick:sender];
    }
}

//  点击录音按钮
- (IBAction)clickRecordBtn:(id)sender {
    if([self.delegate respondsToSelector:@selector(recordBtnClick)]){
        [self.delegate recordBtnClick];
    }
}

@end
